package com.abc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;

/**
 * 校验配置类
 * 配置Bean Validation相关设置
 */
@Configuration
public class ValidationConfig {

    /**
     * 启用方法级别的参数校验
     * 支持在方法参数上使用@Valid注解
     */
    @Bean
    public MethodValidationPostProcessor methodValidationPostProcessor() {
        return new MethodValidationPostProcessor();
    }
}
